// run: $exec > input
// opt: 0
// flag: -g
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cstdlib>
#include <ctime>

int const maxn = 700;
bool vis[maxn][maxn];
int a[maxn][maxn];

int main()
{
	std::srand(std::time(0));
	int n = (rand() % 10) + 2;
    int m = rand() % (n * n);
    m++;
    std::cout << n << " " << m << "\n";
    for (int i = 0; i < m; i++) {
        int x, y;
        do {
            x = (rand() % n) + 1;
            y = (rand() % n) + 1;
            if (x != y) break;
        } while (true);
        std::cout << x << " " << y << "\n";
    }
}

